﻿using System;
using System.Collections.Generic;
using System.Web;

namespace CNVP.JShop.Web.Admin
{
    /// <summary>
    /// ProductStockTotal 的摘要说明
    /// </summary>
    public class ProductStockTotal : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string value = string.Empty;
            int productDetailID = string.IsNullOrEmpty(context.Request["productDetailID"]) ? 0 : int.Parse(context.Request["productDetailID"]);
            if (productDetailID > 0)
            {
                CNVP.JShop.Model.CNVP_ProductsDetail model =  new CNVP.JShop.BLL.CNVP_ProductsDetail().GetSingle_CNVP_ProductsDetailById(productDetailID);
                if (model != null)
                {
                    value = model.StockNum.ToString();
                }
            }
            context.Response.Write(value);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}